package cn.huijielong.modules.group.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

import cn.huijielong.modules.group.dao.OrderItemDao;
import cn.huijielong.modules.group.entity.OrderItemEntity;
import cn.huijielong.modules.group.service.OrderItemService;
import cn.huijielong.modules.sys.service.impl.SimpleServiceImpl;
import cn.huijielong.common.utils.Query;



@Service("orderItemService")
public class OrderItemServiceImpl extends SimpleServiceImpl implements OrderItemService {
	@Autowired
	private OrderItemDao orderItemDao;
	
	@Override
	public OrderItemEntity queryObject(Long orderId){
		return orderItemDao.queryObject(orderId);
	}
	
	@Override
	public Page<OrderItemEntity> queryList(Query q){
	    Page<OrderItemEntity> page=PageHelper.startPage(q.getPage(), q.getLimit()).doSelectPage(()-> orderItemDao.queryList(q));
		return page;		
	}
	
	@Override
	public int queryTotal(Map<String, Object> map){
		return orderItemDao.queryTotal(map);
	}
	
	@Override
	public void save(OrderItemEntity orderItem){
		orderItemDao.save(orderItem);
	}
	
	@Override
	public void update(OrderItemEntity orderItem){
		orderItemDao.update(orderItem);
	}
	
	@Override
	public void delete(Long orderId){
		orderItemDao.delete(orderId);
	}
	
	@Override
	public void deleteBatch(Long[] orderIds){
		orderItemDao.deleteBatch(orderIds);
	}
	
}
